home *** CD-ROM | disk | FTP | other *** search
- diff -u -r --new-file last-version/docs/BROWSING.txt samba-1.9.15p2/docs/BROWSING.txt
- --- last-version/docs/BROWSING.txt Tue Nov 14 22:29:10 1995
- +++ samba-1.9.15p2/docs/BROWSING.txt Tue Nov 21 12:46:25 1995
- @@ -113,4 +113,3 @@
- address it sends to, not what it listens on.
-
-
- -
- diff -u -r --new-file last-version/docs/THANKS samba-1.9.15p2/docs/THANKS
- --- last-version/docs/THANKS Sun Sep 3 11:41:21 1995
- +++ samba-1.9.15p2/docs/THANKS Tue Nov 21 11:56:40 1995
- @@ -91,3 +91,29 @@
- NTAS. Being able to directly test NT3.5 allowed me to solve
- several long standing NT<->Samba problems. Thanks Steve!
-
- +John Terpstra (jht@aquasoft.com.au)
- +
- + Aquasoft are a speciaist consulting company whose Samba using
- + customers span the world.
- +
- + Aquasoft have been avid supporters of the Samba project. As a
- + token of appreciation Aquasoft have donated a 486DX2/66 PC with
- + a 540MB EIDE drive and 20MB RAM.
- +
- + John has helped to isolate quite a few little glitches over time
- + and has managed to implement some very interesting installations
- + of Samba.
- +
- + The donation of the new PC will make it possible to more fully
- + diagnose and observe the behaviour of Samba in conjuction with
- + other SMB protocol utilising systems.
- +
- +
- +Timothy F. Sipples (tsipple@vnet.IBM.COM)
- +Steve Withers (swithers@vnet.IBM.COM)
- +
- + Tim and Steve from IBM organised a copy of the OS/2 developers
- + connection CD set for me, and gave lots of help in getting
- + OS/2 Warp installed. I hope this will allow me to finally fix
- + up those annoying OS/2 related Samba bugs that I have been
- + receiving reports of.
- diff -u -r --new-file last-version/source/Makefile samba-1.9.15p2/source/Makefile
- --- last-version/source/Makefile Tue Nov 14 21:28:52 1995
- +++ samba-1.9.15p2/source/Makefile Tue Nov 21 11:27:50 1995
- @@ -49,7 +49,7 @@
- # for browsing. This can also be set in nmbd (see nmbd(8))
- # NOTE: If you set it to * then nmbd will try to find a workgroup on
- # the local net
- -WORKGROUP = *
- +WORKGROUP = WORKGROUP
-
- # set this to the name of the default account, which is the one
- # to use when no username or password is specified. This can be overridden
- diff -u -r --new-file last-version/source/change-log samba-1.9.15p2/source/change-log
- --- last-version/source/change-log Wed Nov 15 02:36:30 1995
- +++ samba-1.9.15p2/source/change-log Tue Nov 21 12:50:13 1995
- @@ -1668,14 +1668,23 @@
- <Jeroen.Schipper@let.ruu.nl>
- - fixed critical bug in directory listings
- - released p1
- + - fixed one of the causes of "out of memory" while browsing
- + - fixed manpage install script (Paul Blackman)
- + - added DNS failures to name cache
- + - fixed writebmpx bug (affects OS/2)
- + - misc OS/2 fixes, mostly for EA handling
- + - added SMBcopy
- + - added "max ttl" option
- + - arch detection patch from Bas Laarhoven <bas@vimec.nl>
-
- -
- ==========
- todo:
-
- +document max ttl option
- +
- dup/close 0 for getopt?
-
- -implement SMBmove and SMBcopy ??
- +implement SMBmove ??
-
- add option to print more info about locked files (full path, share name
- etc)
- diff -u -r --new-file last-version/source/client.c samba-1.9.15p2/source/client.c
- --- last-version/source/client.c Tue Nov 14 21:54:30 1995
- +++ samba-1.9.15p2/source/client.c Mon Nov 20 18:54:04 1995
- @@ -2204,6 +2204,68 @@
-
-
- /****************************************************************************
- + get info on a file
- + ****************************************************************************/
- +static void cmd_stat(char *inbuf,char *outbuf)
- +{
- + fstring buf;
- + pstring fname;
- + char *resp_data=NULL;
- + char *resp_param=NULL;
- + int resp_data_len = 0;
- + int resp_param_len=0;
- + char *p;
- +
- + if (!next_token(NULL,buf,NULL)) {
- + printf("stat <file>\n");
- + return;
- + }
- +
- + strcpy(fname,cur_dir);
- + strcat(fname,buf);
- +
- + bzero(outbuf,smb_setup);
- + set_message(outbuf,15,5 + 6 + strlen(fname)+1,True);
- + CVAL(outbuf,smb_com) = SMBtrans2;
- + SSVAL(outbuf,smb_tid,cnum);
- + setup_pkt(outbuf);
- +
- + SSVAL(outbuf,smb_tpscnt,6 + strlen(fname)+1);
- + SSVAL(outbuf,smb_tdscnt,0);
- + SSVAL(outbuf,smb_mprcnt,2);
- + SSVAL(outbuf,smb_mdrcnt,26);
- + SSVAL(outbuf,smb_msrcnt,0);
- + SSVAL(outbuf,smb_flags,0);
- + SIVAL(outbuf,smb_timeout,0);
- + SSVAL(outbuf,smb_pscnt,SVAL(outbuf,smb_tpscnt));
- + SSVAL(outbuf,smb_psoff,smb_offset(smb_buf(outbuf)+3,outbuf));
- + SSVAL(outbuf,smb_dscnt,0);
- + SSVAL(outbuf,smb_dsoff,0);
- + SSVAL(outbuf,smb_suwcnt,1);
- +
- + SSVAL(outbuf,smb_setup0,TRANSACT2_QPATHINFO);
- +
- + p = smb_buf(outbuf);
- + *p++ = 0; /* put in a null smb_name */
- + *p++ = 'D'; *p++ = ' '; /* this was added because OS/2 does it */
- +
- + SSVAL(p,0,2); /* level */
- + p += 6;
- + strcpy(p,fname);
- + p = skip_string(p,1);
- +
- + send_smb(outbuf);
- +
- + receive_trans2_response(inbuf,
- + &resp_data_len,&resp_param_len,
- + &resp_data,&resp_param);
- +
- + if (resp_data) free(resp_data); resp_data = NULL;
- + if (resp_param) free(resp_param); resp_param = NULL;
- +}
- +
- +
- +/****************************************************************************
- print a file
- ****************************************************************************/
- static void cmd_print(char *inbuf,char *outbuf )
- @@ -3499,6 +3561,7 @@
- {"printmode",cmd_printmode,"<graphics or text> set the print mode"},
- {"queue",cmd_queue,"show the print queue"},
- {"cancel",cmd_cancel,"<jobid> cancel a print queue entry"},
- + {"stat",cmd_stat,"<file> get info on a file (experimental!)"},
- {"quit",send_logout,"logoff the server"},
- {"exit",send_logout,"logoff the server"},
- {"newer",cmd_newer,"<file> only mget files newer than the specified local file"},
- diff -u -r --new-file last-version/source/installman.sh samba-1.9.15p2/source/installman.sh
- --- last-version/source/installman.sh Thu Jun 29 17:38:03 1995
- +++ samba-1.9.15p2/source/installman.sh Sat Nov 18 20:36:53 1995
- @@ -3,11 +3,16 @@
-
- echo Installing man pages in $MANDIR
-
- -mkdir $MANDIR
- -mkdir $MANDIR/man1
- -mkdir $MANDIR/man5
- -mkdir $MANDIR/man8
- -mkdir $MANDIR/man7
- +for d in $MANDIR $MANDIR/man1 $MANDIR/man5 $MANDIR/man7 $MANDIR/man8; do
- +if [ ! -d $d ]; then
- +mkdir $d
- +if [ ! -d $d ]; then
- + echo Failed to make directory $d
- + exit 1
- +fi
- +fi
- +done
- +
- cp ../docs/*.1 $MANDIR/man1
- cp ../docs/*.5 $MANDIR/man5
- cp ../docs/*.8 $MANDIR/man8
- diff -u -r --new-file last-version/source/ipc.c samba-1.9.15p2/source/ipc.c
- --- last-version/source/ipc.c Sun Nov 12 18:39:37 1995
- +++ samba-1.9.15p2/source/ipc.c Sat Nov 18 02:08:09 1995
- @@ -1008,7 +1008,7 @@
-
- len = struct_len;
- p = *buf;
- - if (*buflen < struct_len) return -1;
- + if ((*buflen) < struct_len) return -1;
- if (stringbuf)
- {
- p2 = *stringbuf;
- @@ -1017,7 +1017,7 @@
- else
- {
- p2 = p + struct_len;
- - l2 = *buflen - struct_len;
- + l2 = (*buflen) - struct_len;
- }
- if (!baseaddr) baseaddr = p;
-
- @@ -1059,15 +1059,15 @@
-
- if (stringbuf)
- {
- - *buf = p + struct_len;
- - *buflen -= struct_len;
- - *stringbuf = p2;
- - *stringspace = l2;
- + (*buf) = p + struct_len;
- + (*buflen) -= struct_len;
- + (*stringbuf) = p2;
- + (*stringspace) = l2;
- }
- else
- {
- - *buf = p2;
- - *buflen -= len;
- + (*buf) = p2;
- + (*buflen) -= len;
- }
- return len;
- }
- @@ -1626,21 +1626,21 @@
- p += 4;
-
- SIVAL(p,0,PTR_DIFF(p2,*rdata));
- - strcpy(p2,lp_workgroup());
- + strcpy(p2,my_workgroup());
- p2 = skip_string(p2,1);
- p += 4;
-
- - SCVAL(p,0,1);
- - SCVAL(p,1,9);
- + SCVAL(p,0,1); /* major version?? */
- + SCVAL(p,1,9); /* minor version?? */
- p += 2;
-
- SIVAL(p,0,PTR_DIFF(p2,*rdata));
- - strcpy(p2,lp_workgroup()); /* login domain */
- + strcpy(p2,my_workgroup()); /* login domain?? */
- p2 = skip_string(p2,1);
- p += 4;
-
- SIVAL(p,0,PTR_DIFF(p2,*rdata));
- - strcpy(p2,"info 2");
- + strcpy(p2,"");
- p2 = skip_string(p2,1);
- p += 4;
-
- @@ -1826,7 +1826,7 @@
- PACKI(&desc,"D",0); /* password can change */
- PACKI(&desc,"D",-1); /* password must change */
- PACKS(&desc,"z",local_machine);/* computer */
- - PACKS(&desc,"z",lp_workgroup());/* domain */
- + PACKS(&desc,"z",my_workgroup());/* domain */
- PACKS(&desc,"z",""); /* script path */
- PACKI(&desc,"D",0); /* reserved */
- }
- diff -u -r --new-file last-version/source/loadparm.c samba-1.9.15p2/source/loadparm.c
- --- last-version/source/loadparm.c Wed Nov 15 00:05:39 1995
- +++ samba-1.9.15p2/source/loadparm.c Tue Nov 21 12:42:00 1995
- @@ -143,6 +143,7 @@
- int maxdisksize;
- int lpqcachetime;
- int os_level;
- + int max_ttl;
- BOOL bPreferredMaster;
- BOOL bEncryptPasswords;
- BOOL bStripDot;
- @@ -391,6 +392,7 @@
- {"coding system", P_INTEGER, P_GLOBAL, &coding_system, handle_coding_system},
- #endif /* KANJI */
- {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL},
- + {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL},
- {"preferred master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL},
-
- {"-valid", P_BOOL, P_LOCAL, &sDefault.valid, NULL},
- @@ -534,6 +536,7 @@
- Globals.bNullPasswords = False;
- Globals.bStripDot = False;
- Globals.os_level = 0;
- + Globals.max_ttl = 60*60*4; /* 2 hours default */
- Globals.bPreferredMaster = True;
-
- #ifdef KANJI
- @@ -657,6 +660,7 @@
-
-
- FN_GLOBAL_INTEGER(lp_os_level,&Globals.os_level)
- +FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl)
- FN_GLOBAL_INTEGER(lp_max_log_size,&Globals.max_log_size)
- FN_GLOBAL_INTEGER(lp_mangledstack,&Globals.mangled_stack)
- FN_GLOBAL_INTEGER(lp_maxxmit,&Globals.max_xmit)
- @@ -1813,4 +1817,14 @@
-
-
-
- +
- +/*******************************************************************
- + get a workgroup - but map to standalone if '*'
- + ******************************************************************/
- +char *my_workgroup(void)
- +{
- + char *res = lp_workgroup();
- + if (*res == '*') return("STANDALONE");
- + return(res);
- +}
-
- diff -u -r --new-file last-version/source/loadparm.h samba-1.9.15p2/source/loadparm.h
- --- last-version/source/loadparm.h Tue Nov 14 20:59:30 1995
- +++ samba-1.9.15p2/source/loadparm.h Tue Nov 21 12:42:14 1995
- @@ -57,6 +57,7 @@
- extern char *lp_magicoutput(int iService);
- extern char *lp_mangled_map(int iService);
- extern int lp_os_level(void);
- +extern int lp_max_ttl(void);
- extern int lp_max_log_size(void);
- extern int lp_maxxmit(void);
- extern int lp_maxmux(void);
- @@ -144,4 +145,6 @@
- extern int lp_max_connections(int iService);
- extern BOOL lp_add_home(char *pservice,int ifrom,char *phome);
- extern char *lp_string(char *s);
- +char *my_workgroup(void);
- +
- #endif
- diff -u -r --new-file last-version/source/nameserv.c samba-1.9.15p2/source/nameserv.c
- --- last-version/source/nameserv.c Wed Nov 15 01:28:08 1995
- +++ samba-1.9.15p2/source/nameserv.c Tue Nov 21 12:44:03 1995
- @@ -445,6 +445,13 @@
- add_server_entry(myname,
- ServerType,
- 0,ServerComment);
- +
- + if (lp_preferred_master()) {
- + needelection = True;
- + ElectionCriterion |= (1<<3);
- + }
- +
- + ElectionCriterion |= (lp_os_level() << 24);
- }
-
-
- @@ -483,6 +490,7 @@
-
- fclose(f);
- unlink(fname);
- + chmod(fnamenew,0644);
- rename(fnamenew,fname);
- DEBUG(3,("Wrote browse list %s\n",fname));
- }
- @@ -978,6 +986,8 @@
-
- if (!listening(&dgram->dest_name)) return;
-
- + ttl = MIN(ttl,lp_max_ttl());
- +
- /* add them to our browse list */
- add_server_entry(name,servertype,ttl,comment);
- }
- @@ -1310,7 +1320,7 @@
- char *qname = nmb->question.question_name.name;
- BOOL wildcard = (qname[0] == '*');
- BOOL bcast = nmb->header.nm_flags.bcast;
- - int ttl = nmb->additional->ttl;
- + int ttl = MIN(lp_max_ttl(),nmb->additional->ttl);
- int name_type = nmb->question.question_name.name_type;
- int nb_flags = nmb->additional->rdata[0];
- struct packet_struct p2;
- @@ -1533,15 +1543,17 @@
- /* look it up with DNS */
- a = interpret_addr(qname);
-
- + putip((char *)&ip,(char *)&a);
- +
- if (!a) {
- /* no luck with DNS. We could possibly recurse here XXXX */
- /* if this isn't a bcast then we should send a negative reply XXXX */
- DEBUG(3,("no recursion\n"));
- + add_host_entry(qname,name_type,True,60*60,DNSFAIL,ip);
- return;
- }
-
- /* add it to our cache of names. give it 2 hours in the cache */
- - putip((char *)&ip,(char *)&a);
- n = add_host_entry(qname,name_type,True,2*60*60,DNS,ip);
-
- /* failed to add it? yikes! */
- @@ -1571,7 +1583,13 @@
-
- retip = n->ip;
- unique = n->unique;
- - }
- +
- + /* it may have been an earlier failure */
- + if (n->source == DNSFAIL) {
- + DEBUG(3,("DNSFAIL\n"));
- + return;
- + }
- + }
-
- /* if the IP is 0 then substitute my IP - we should see which one is on the
- right interface for the caller to do this right XXX */
- @@ -1882,13 +1900,6 @@
- if (p) *p = 0;
- }
-
- - if (lp_preferred_master()) {
- - needelection = True;
- - ElectionCriterion |= (1<<3);
- - }
- -
- - ElectionCriterion |= (lp_os_level() << 28);
- -
- return True;
- }
-
- @@ -2027,6 +2038,8 @@
- DEBUG(1,("%s netbios nameserver version %s started\n",timestring(),VERSION));
- DEBUG(1,("Copyright Andrew Tridgell 1994\n"));
-
- + init_structs();
- +
- if (!reload_services(False))
- return(-1);
-
- @@ -2035,8 +2048,6 @@
- load_hosts_file(host_file);
- DEBUG(3,("Loaded hosts file\n"));
- }
- -
- - init_structs();
-
- if (!*ServerComment)
- strcpy(ServerComment,"Samba %v");
- diff -u -r --new-file last-version/source/nameserv.h samba-1.9.15p2/source/nameserv.h
- --- last-version/source/nameserv.h Sun Nov 12 13:40:15 1995
- +++ samba-1.9.15p2/source/nameserv.h Sun Nov 19 17:50:31 1995
- @@ -26,7 +26,7 @@
- #define NMB_PORT 137
- #define DGRAM_PORT 138
-
- -enum name_source {LMHOSTS, REGISTER, SELF, DNS};
- +enum name_source {LMHOSTS, REGISTER, SELF, DNS, DNSFAIL};
- enum node_type {B_NODE=0, P_NODE=1, M_NODE=2, NBDD_NODE=3};
- enum packet_type {NMB_PACKET, DGRAM_PACKET};
-
- diff -u -r --new-file last-version/source/reply.c samba-1.9.15p2/source/reply.c
- --- last-version/source/reply.c Mon Nov 13 19:30:23 1995
- +++ samba-1.9.15p2/source/reply.c Tue Nov 21 00:06:48 1995
- @@ -410,7 +410,7 @@
- p = smb_buf(outbuf);
- strcpy(p,"Unix"); p = skip_string(p,1);
- strcpy(p,"Samba "); strcat(p,VERSION); p = skip_string(p,1);
- - strcpy(p,lp_workgroup()); p = skip_string(p,1);
- + strcpy(p,my_workgroup()); p = skip_string(p,1);
- outsize = set_message(outbuf,3,PTR_DIFF(p,smb_buf(outbuf)),False);
- /* perhaps grab OS version here?? */
- }
- @@ -2566,7 +2566,194 @@
- return(outsize);
- }
-
- +/*******************************************************************
- + copy a file as part of a reply_copy
- + ******************************************************************/
- +static BOOL copy_file(char *src,char *dest1,int cnum,int ofun,
- + int count,BOOL target_is_directory)
- +{
- + int Access,action;
- + struct stat st;
- + int ret;
- + int fnum1,fnum2;
- + pstring dest;
- +
- + strcpy(dest,dest1);
- + if (target_is_directory) {
- + char *p = strrchr(src,'/');
- + if (p)
- + p++;
- + else
- + p = src;
- + strcat(dest,"/");
- + strcat(dest,p);
- + }
- +
- + if (!file_exist(src,&st)) return(False);
- +
- + fnum1 = find_free_file();
- + if (fnum1<0) return(False);
- + open_file_shared(fnum1,cnum,src,(DENY_NONE<<4),
- + 1,0,&Access,&action);
- +
- + if (!Files[fnum1].open) return(False);
- +
- + if (!target_is_directory && count)
- + ofun = 1;
- +
- + fnum2 = find_free_file();
- + if (fnum2<0) {
- + close_file(fnum1);
- + return(False);
- + }
- + open_file_shared(fnum2,cnum,dest,(DENY_NONE<<4)|1,
- + ofun,st.st_mode,&Access,&action);
- +
- + if (!Files[fnum2].open) {
- + close_file(fnum1);
- + return(False);
- + }
- +
- + if ((ofun&3) == 1) {
- + lseek(Files[fnum2].fd,0,SEEK_END);
- + }
- +
- + if (st.st_size)
- + ret = transfer_file(Files[fnum1].fd,Files[fnum2].fd,st.st_size,NULL,0,0);
- +
- + close_file(fnum1);
- + close_file(fnum2);
- +
- + return(ret == st.st_size);
- +}
- +
- +
- +
- +/****************************************************************************
- + reply to a file copy.
- + ****************************************************************************/
- +int reply_copy(char *inbuf,char *outbuf)
- +{
- + int outsize = 0;
- + pstring name;
- + int cnum;
- + pstring directory;
- + pstring mask,newname;
- + char *p;
- + int count=0;
- + int error = ERRnoaccess;
- + BOOL has_wild;
- + BOOL exists=False;
- + int tid2 = SVAL(inbuf,smb_vwv0);
- + int ofun = SVAL(inbuf,smb_vwv1);
- + int flags = SVAL(inbuf,smb_vwv2);
- + BOOL target_is_directory=False;
- +
- + *directory = *mask = 0;
- +
- + cnum = SVAL(inbuf,smb_tid);
- +
- + strcpy(name,smb_buf(inbuf));
- + strcpy(newname,smb_buf(inbuf) + 1 + strlen(name));
- +
- + DEBUG(3,("reply_copy : %s -> %s\n",name,newname));
- +
- + if (tid2 != cnum) {
- + /* can't currently handle inter share copies XXXX */
- + DEBUG(3,("Rejecting inter-share copy\n"));
- + return(ERROR(ERRSRV,ERRinvdevice));
- + }
- +
- + unix_convert(name,cnum);
- + unix_convert(newname,cnum);
- +
- + target_is_directory = directory_exist(newname,NULL);
- +
- + if ((flags&1) && target_is_directory) {
- + return(ERROR(ERRDOS,ERRbadfile));
- + }
- +
- + if ((flags&2) && !target_is_directory) {
- + return(ERROR(ERRDOS,ERRbadpath));
- + }
- +
- + if ((flags&(1<<5)) && directory_exist(name,NULL)) {
- + /* wants a tree copy! XXXX */
- + DEBUG(3,("Rejecting tree copy\n"));
- + return(ERROR(ERRSRV,ERRerror));
- + }
- +
- + p = strrchr(name,'/');
- + if (!p) {
- + strcpy(directory,"./");
- + strcpy(mask,name);
- + } else {
- + *p = 0;
- + strcpy(directory,name);
- + strcpy(mask,p+1);
- + }
- +
- + if (is_mangled(mask))
- + check_mangled_stack(mask);
- +
- + has_wild = strchr(mask,'*') || strchr(mask,'?');
- +
- + if (!has_wild) {
- + strcat(directory,"/");
- + strcat(directory,mask);
- + if (resolve_wildcards(directory,newname) &&
- + copy_file(directory,newname,cnum,ofun,
- + count,target_is_directory)) count++;
- + if (!count) exists = file_exist(directory,NULL);
- + } else {
- + void *dirptr = NULL;
- + char *dname;
- + pstring destname;
- +
- + if (check_name(directory,cnum))
- + dirptr = OpenDir(directory);
- +
- + if (dirptr)
- + {
- + error = ERRbadfile;
- +
- + if (strequal(mask,"????????.???"))
- + strcpy(mask,"*");
- +
- + while ((dname = ReadDirName(dirptr)))
- + {
- + pstring fname;
- + strcpy(fname,dname);
- +
- + if(!mask_match(fname, mask, case_sensitive, False)) continue;
- +
- + error = ERRnoaccess;
- + sprintf(fname,"%s/%s",directory,dname);
- + strcpy(destname,newname);
- + if (resolve_wildcards(fname,destname) &&
- + copy_file(directory,newname,cnum,ofun,
- + count,target_is_directory)) count++;
- + DEBUG(3,("reply_copy : doing copy on %s -> %s\n",fname,destname));
- + }
- + CloseDir(dirptr);
- + }
- + }
- +
- + if (count == 0) {
- + if (exists)
- + return(ERROR(ERRDOS,error));
- + else
- + return(UNIXERROR(ERRDOS,error));
- + }
- +
- + outsize = set_message(outbuf,1,0,True);
- + SSVAL(outbuf,smb_vwv0,count);
-
- + return(outsize);
- +}
- +
- +
- +
- /****************************************************************************
- reply to a setdir
- ****************************************************************************/
- @@ -2837,6 +3024,17 @@
- DEBUG(3,("%s writebmpx fnum=%d cnum=%d num=%d wrote=%d\n",
- timestring(),fnum,cnum,numtowrite,nwritten));
-
- + if (write_through && tcount==nwritten) {
- + /* we need to send both a primary and a secondary response */
- + smb_setlen(outbuf,outsize - 4);
- + send_smb(outbuf);
- +
- + /* now the secondary */
- + outsize = set_message(outbuf,1,0,True);
- + CVAL(outbuf,smb_com) = SMBwritec;
- + SSVAL(outbuf,smb_vwv0,nwritten);
- + }
- +
- return(outsize);
- }
-
- diff -u -r --new-file last-version/source/reply.h samba-1.9.15p2/source/reply.h
- --- last-version/source/reply.h Sat Apr 22 21:10:39 1995
- +++ samba-1.9.15p2/source/reply.h Mon Nov 20 22:59:13 1995
- @@ -45,6 +45,7 @@
- int reply_mkdir(char *inbuf,char *outbuf);
- int reply_rmdir(char *inbuf,char *outbuf);
- int reply_mv(char *inbuf,char *outbuf);
- +int reply_copy(char *inbuf,char *outbuf);
- int reply_setdir(char *inbuf,char *outbuf);
- int reply_lockingX(char *inbuf,char *outbuf,int length,int bufsize);
- int reply_readbmpx(char *inbuf,char *outbuf,int length,int bufsize);
- diff -u -r --new-file last-version/source/server.c samba-1.9.15p2/source/server.c
- --- last-version/source/server.c Tue Nov 14 23:15:32 1995
- +++ samba-1.9.15p2/source/server.c Tue Nov 21 12:49:16 1995
- @@ -1212,6 +1212,14 @@
- Files[fnum].open = False;
- Files[fnum].fd = -1;
-
- + /* this is for OS/2 EAs - try and say we don't support them */
- + if (strstr(fname,".+,;=[].")) {
- + /* errno = ENOENT; */
- + unix_ERR_class = ERRDOS;
- + unix_ERR_code = ERROR_EAS_NOT_SUPPORTED;
- + return;
- + }
- +
- if ((ofun & 0x3) == 0 && file_existed) {
- errno = EEXIST;
- return;
- @@ -2459,7 +2467,7 @@
- !pcon->read_only)
- {
- pcon->admin_user = True;
- - DEBUG(0,("%s logged in as admin user (root privilages)\n",user));
- + DEBUG(0,("%s logged in as admin user (root privileges)\n",user));
- }
- else
- pcon->admin_user = False;
- @@ -2864,37 +2872,36 @@
- int protocol;
- char *p;
- int bcc = SVAL(smb_buf(inbuf),-2);
- + int maybe_win95 = 0;
- + int arch_known = 0;
-
- - /* look through the protocol list */
- + /* look through the protocol list to determine architecture */
- Index = 0;
- p = smb_buf(inbuf)+1;
- while (p < (smb_buf(inbuf) + bcc))
- {
- DEBUG(3,("protocol [%s]\n",p));
- - if (strcsequal(p,"Windows for Workgroups 3.1a"))
- - strcpy(remote_arch,"WfWg");
- -
- - if (strcsequal(p,"Samba")) {
- - strcpy(remote_arch,"Samba");
- - break; /* definite */
- - }
- -
- - if (strcsequal(p,"NT LM 0.12"))
- - strcpy(remote_arch,"WinNT");
- -
- - if (strcsequal(p,"DOS LANMAN2.1")) {
- - strcpy(remote_arch,"Win95");
- - break; /* definite */
- + if (!arch_known) {
- + if (strcsequal(p,"Samba")) {
- + strcpy(remote_arch,"Samba");
- + arch_known = 1;
- + } else if (strcsequal(p,"NT LM 0.12")) {
- + if (maybe_win95)
- + strcpy(remote_arch,"Win95");
- + else
- + strcpy(remote_arch,"WinNT");
- + } else if (strcsequal(p,"Windows for Workgroups 3.1a")) {
- + strcpy(remote_arch,"WfWg");
- + maybe_win95 = 1;
- + }
- + Index++;
- }
- -
- p += strlen(p) + 2;
- - Index++;
- }
- -
- -
- +
- /* possibly reload - change of architecture */
- reload_services(True);
- -
- +
- /* a special case to stop password server loops */
- if (Index == 1 && strequal(remote_machine,myhostname) &&
- lp_security()==SEC_SERVER)
- @@ -3418,7 +3425,7 @@
- {SMBtrans,"SMBtrans",reply_trans,AS_USER | CAN_IPC},
- {SMBtranss,"SMBtranss",NULL,AS_USER | CAN_IPC},
- {SMBioctls,"SMBioctls",NULL,AS_USER},
- - {SMBcopy,"SMBcopy",NULL,AS_USER},
- + {SMBcopy,"SMBcopy",reply_copy,AS_USER | NEED_WRITE},
- {SMBmove,"SMBmove",NULL,AS_USER | NEED_WRITE},
-
- {SMBopenX,"SMBopenX",reply_open_and_X,AS_USER},
- diff -u -r --new-file last-version/source/status.c samba-1.9.15p2/source/status.c
- --- last-version/source/status.c Mon Nov 13 15:53:03 1995
- +++ samba-1.9.15p2/source/status.c Fri Nov 17 08:33:15 1995
- @@ -135,7 +135,8 @@
- else
- printf("%-10.10s %-8s %-8s %5d %-8s (%s) %s",
- crec.name,uidtoname(crec.uid),gidtoname(crec.gid),crec.pid,
- - crec.machine,crec.addr,asctime(LocalTime(&crec.start,0)));
- + crec.machine,crec.addr,
- + asctime(LocalTime(&crec.start,GMT_TO_LOCAL)));
- }
- }
- fclose(f);
- diff -u -r --new-file last-version/source/trans2.c samba-1.9.15p2/source/trans2.c
- --- last-version/source/trans2.c Tue Nov 14 21:58:26 1995
- +++ samba-1.9.15p2/source/trans2.c Mon Nov 20 19:08:34 1995
- @@ -31,6 +31,7 @@
- extern files_struct Files[];
- extern BOOL case_sensitive;
-
- +#define ROUNDUP(x,g) (((x)+((g)-1))&~((g)-1))
-
- /****************************************************************************
- Send the required number of replies back.
- @@ -371,7 +372,7 @@
- put_dos_date2(p,l1_fdateLastAccess,adate);
- put_dos_date2(p,l1_fdateLastWrite,mdate);
- SIVAL(p,l1_cbFile,size);
- - SIVAL(p,l1_cbFileAlloc,1024); /* Make 1024 for now */
- + SIVAL(p,l1_cbFileAlloc,ROUNDUP(size,1024));
- SSVAL(p,l1_attrFile,mode);
- SCVAL(p,l1_cchName,strlen(fname));
- strcpy(p + l1_achName, fname);
- @@ -389,7 +390,7 @@
- put_dos_date2(p,l2_fdateLastAccess,adate);
- put_dos_date2(p,l2_fdateLastWrite,mdate);
- SIVAL(p,l2_cbFile,size);
- - SIVAL(p,l2_cbFileAlloc,1024); /* Make 1024 for now */
- + SIVAL(p,l2_cbFileAlloc,ROUNDUP(size,1024));
- SSVAL(p,l2_attrFile,mode);
- SIVAL(p,l2_cbList,0); /* No extended attributes */
- SCVAL(p,l2_cchName,strlen(fname));
- @@ -404,7 +405,7 @@
- put_dos_date2(p,8,adate);
- put_dos_date2(p,12,mdate);
- SIVAL(p,16,size);
- - SIVAL(p,20,1024);
- + SIVAL(p,20,ROUNDUP(size,1024));
- SSVAL(p,24,mode);
- SIVAL(p,26,4);
- CVAL(p,30) = strlen(fname);
- @@ -423,7 +424,7 @@
- put_dos_date2(p,8,adate);
- put_dos_date2(p,12,mdate);
- SIVAL(p,16,size);
- - SIVAL(p,20,1024);
- + SIVAL(p,20,ROUNDUP(size,1024));
- SSVAL(p,24,mode);
- CVAL(p,32) = strlen(fname);
- strcpy(p + 33, fname);
- @@ -970,7 +971,9 @@
- reply to a TRANS2_QFILEINFO (query file info by fileid)
- ****************************************************************************/
- static int call_trans2qfilepathinfo(char *inbuf, char *outbuf, int length,
- - int bufsize,int cnum,char **pparams,char **ppdata)
- + int bufsize,int cnum,
- + char **pparams,char **ppdata,
- + int total_data)
- {
- char *params = *pparams;
- char *pdata = *ppdata;
- @@ -1013,8 +1016,8 @@
- }
-
-
- - DEBUG(3,("call_trans2qfilepathinfo %s level=%d call=%d\n",
- - fname,info_level,tran_call));
- + DEBUG(3,("call_trans2qfilepathinfo %s level=%d call=%d total_data=%d\n",
- + fname,info_level,tran_call,total_data));
-
- p = strrchr(fname,'/');
- if (!p)
- @@ -1028,8 +1031,22 @@
-
- params = *pparams = Realloc(*pparams,2); bzero(params,2);
- data_size = 1024;
- - pdata = *ppdata = Realloc(*ppdata, data_size); bzero(pdata,data_size);
- + pdata = *ppdata = Realloc(*ppdata, data_size);
-
- + if (total_data > 0 && IVAL(pdata,0) == total_data) {
- + /* uggh, EAs for OS2 */
- + DEBUG(4,("Rejecting EA request with total_data=%d\n",total_data));
- +#if 0
- + SSVAL(params,0,ERROR_EAS_NOT_SUPPORTED);
- + send_trans2_replies(outbuf, bufsize, params, 2, *ppdata, 0);
- + return(-1);
- +#else
- + return(ERROR(ERRDOS,ERROR_EAS_NOT_SUPPORTED));
- +#endif
- + }
- +
- + bzero(pdata,data_size);
- +
- switch (info_level)
- {
- case 1:
- @@ -1039,8 +1056,9 @@
- put_dos_date2(pdata,l1_fdateLastAccess,sbuf.st_atime);
- put_dos_date2(pdata,l1_fdateLastWrite,sbuf.st_mtime);
- SIVAL(pdata,l1_cbFile,size);
- - SIVAL(pdata,l1_cbFileAlloc,1024); /* Make 1024 for now */
- + SIVAL(pdata,l1_cbFileAlloc,ROUNDUP(size,1024));
- SSVAL(pdata,l1_attrFile,mode);
- + SIVAL(pdata,l1_attrFile+2,4); /* this is what OS2 does */
- break;
-
- case 3:
- @@ -1050,7 +1068,7 @@
- put_dos_date2(pdata,4,sbuf.st_atime);
- put_dos_date2(pdata,8,sbuf.st_mtime);
- SIVAL(pdata,12,size);
- - SIVAL(pdata,16,1024);
- + SIVAL(pdata,16,ROUNDUP(size,1024));
- SIVAL(pdata,20,mode);
- break;
-
- @@ -1203,6 +1221,16 @@
- tvs.actime = st.st_atime;
- mode = dos_mode(cnum,fname,&st);
-
- + if (total_data > 0 && IVAL(pdata,0) == total_data) {
- + /* uggh, EAs for OS2 */
- + DEBUG(4,("Rejecting EA request with total_data=%d\n",total_data));
- + SSVAL(params,0,ERROR_EAS_NOT_SUPPORTED);
- +
- + send_trans2_replies(outbuf, bufsize, params, 2, *ppdata, 0);
- +
- + return(-1);
- + }
- +
- switch (info_level)
- {
- case 1:
- @@ -1213,8 +1241,6 @@
- break;
-
- case 2:
- - if(IVAL(pdata,l2_cbList) || total_data>32)
- - return(ERROR(ERRDOS,ERROR_EAS_NOT_SUPPORTED));
- tvs.actime = make_unix_date2(pdata+l1_fdateLastAccess);
- tvs.modtime = make_unix_date2(pdata+l1_fdateLastWrite);
- mode = SVAL(pdata,l1_attrFile);
- @@ -1229,8 +1255,6 @@
- break;
-
- case 4:
- - if (IVAL(pdata,28) != 0 || total_data>36)
- - return(ERROR(ERRDOS,ERROR_EAS_NOT_SUPPORTED));
- tvs.actime = make_unix_date2(pdata+8);
- tvs.modtime = make_unix_date2(pdata+12);
- size = IVAL(pdata,16);
- @@ -1238,7 +1262,7 @@
- break;
-
- case SMB_SET_FILE_BASIC_INFO:
- - pdata += 8; /* create time */
- + pdata += 8; /* create time */
- tvs.actime = interpret_long_date(pdata); pdata += 8;
- tvs.modtime=MAX(interpret_long_date(pdata),interpret_long_date(pdata+8));
- pdata += 16;
- @@ -1246,7 +1270,7 @@
- break;
-
- case SMB_SET_FILE_END_OF_FILE_INFO:
- - if (IVAL(pdata,4) != 0) /* more than 32 bits? */
- + if (IVAL(pdata,4) != 0) /* more than 32 bits? */
- return(ERROR(ERRDOS,ERRunknownlevel));
- size = IVAL(pdata,0);
- break;
- @@ -1257,6 +1281,7 @@
- return(ERROR(ERRDOS,ERRunknownlevel));
- }
-
- +
- if (!tvs.actime) tvs.actime = st.st_atime;
- if (!tvs.modtime) tvs.modtime = st.st_mtime;
- if (!size) size = st.st_size;
- @@ -1552,7 +1577,7 @@
- break;
- case TRANSACT2_QPATHINFO:
- case TRANSACT2_QFILEINFO:
- - outsize = call_trans2qfilepathinfo(inbuf, outbuf, length, bufsize, cnum, ¶ms, &data);
- + outsize = call_trans2qfilepathinfo(inbuf, outbuf, length, bufsize, cnum, ¶ms, &data, total_data);
- break;
- case TRANSACT2_SETPATHINFO:
- case TRANSACT2_SETFILEINFO:
- diff -u -r --new-file last-version/source/util.c samba-1.9.15p2/source/util.c
- --- last-version/source/util.c Wed Nov 15 02:31:00 1995
- +++ samba-1.9.15p2/source/util.c Tue Nov 21 12:39:49 1995
- @@ -3675,7 +3675,7 @@
- } else {
- /* otherwise assume it's a network name of some sort and use Get_Hostbyname */
- if ((hp = Get_Hostbyname(str)) == 0) {
- - DEBUG(0,("Get_Hostbyname: Unknown host. %s\n",str));
- + DEBUG(3,("Get_Hostbyname: Unknown host. %s\n",str));
- return 0;
- }
- putip((char *)&res,(char *)hp->h_addr);
- diff -u -r --new-file last-version/source/version.h samba-1.9.15p2/source/version.h
- --- last-version/source/version.h Wed Nov 15 02:36:44 1995
- +++ samba-1.9.15p2/source/version.h Tue Nov 21 12:52:20 1995
- @@ -1 +1 @@
- -#define VERSION "1.9.15p1"
- +#define VERSION "1.9.15p2"
-